package com.hsb.practice;

import java.util.ArrayList;
import java.util.List;

public class Solution {
	public static void main(String[] args) {
		List<Integer> list = trial_divisio(Integer.valueOf(args[0]));
		int total = 0;
		for (Integer integer : list) {
			total += integer;
		}
		System.out.println(total);
	}

	public static List<Integer> trial_divisio(int n) {
		List<Integer> list = new ArrayList<Integer>();
		int a = 2;
		while (a * a <= n) {
			while (n % a == 0) {
				list.add(a);
				n = n / a;// 7
			}
			a++;// 3
		}
		if (n > 1) {
			list.add(n);
		}
		return list;
	}
}
